1. Field of the Invention
The present invention relates to a system and method for correcting a linear block code, and more particularly, to a system and method applied to an optical recording system for correcting a linear block code.
2. Description of the Prior Art
When an optical recording system is writing or reading the data, it is needed to proceed coding or decoding data in advance. For example, when a digital versatile disc (DVD) is coding and writing the data, an ECC block (Error Correction Code block) is regarded as a unit. The digital data of an ECC block is written in DVD in sequence.
The digital data which are going to be written in DVD are decomposed into a plurality of main data, each of which is 2048 bits, and temporarily stored in a buffer memory in an optical recording system. In a DVD system, each main data has an identification data with 4 bits to represent the position and number and a copyright management information with 6 bits about copyright. The first step of coding the digital data in the DVD system is to proceed error-detecting calculation for calculating the identification data to get an identification error detection code with 2 bits.
After acquiring the identification error detection code, the DVD system temporarily stores the identification data, the identification error detection code, the copyright management information, and the main data into the buffer memory in DVD system, wherein each block is with a form of 12×172 (12 rows and 172 lines). Then the DVD system reads the data temporarily stored in the memory and proceeds error-detecting calculation for the data to acquire an error detection code (EDC).
The identification error detection code and the error detection code use cyclic redundancy code (CRC) to detect whether the data being read out has any error. The CRC, with a good error detecting ability, is used to detect errors. But the CRC can not correct the error data. Therefore, the CRC of prior art can only used to detect errors. Hence, during the coding process for the digital data, calculating the error detection code is a very important step.
After calculating the error detection code, the DVD system reads the main data from the buffer memory, scrambling them to generate a scrambled data, and then storing the scrambled data into the buffer memory. After this step, a scrambled data sector is performed. Because each scrambled data sector is only detected by the error detection code without corrected by an error correction code, after detecting sixteen scrambled data sectors, the DVD system will correct the sixteen scrambled data sector by error correction calculation, in order to generate the error correction code. After the error correction code is stored into the buffer memory, an error detection block is performed.
However, during the data coding process, the problem of data modification often happens. For example, a situation, which one bit in the data changes from 1 to 0 or from 0 to 1, may happen. When this situation happens, the coding technology of prior art must resume calculating the error detection code and the error correction code. This will result in serious hardware waste and executing time waste.
To solve this problem, the U.S. Pat. No. 6,357,030 provides a solution particularly for the method of calculating the error correction code. U.S. Pat. No. 6,357,030 indicates a method which needs not to resume calculating the whole error detection block, but use only the error position and the bits change (from 0 to 1 or from 1 to 0) to resume calculating and generate the corrected error correction code, then adding the corrected error correction code into the original one to get the new error correction code.
However, when correcting, U.S. Pat. No. 6,357,030 has to resume calculating according to the wrong bits to get the error correction code for correction. It is not helpful for saving the hardware resource because the correction code cannot be quickly and directly written. Moreover, U.S. Pat. No. 6,357,030 does not correct the error detection code in the error detection block, so the error detection code still needs to resume calculating.